package cn.kgc.easybuy.service;

import cn.kgc.easybuy.pojo.Category;
import com.github.pagehelper.PageInfo;

import java.util.List;
import java.util.Map;

/**
 * @program: yingzi-wants-to-sleep
 * @description:
 * @author: 敖成
 * @create: 2025-09-11 14:47
 **/
public interface CategoryService {
    List<Category> selectAllCategory();

    PageInfo<Category> selectCategoryByPage(Map<String, Object> params);

    //查找下一级级标题
    List<Category> selectChildCategory(Integer parentId);

    //查询不同级别的所有商品类别
    List<Category> selectCategoryByType(Integer type);

    //查询所有子分类
    List<Category> selectChildren(Integer parentId);

    //查询所有一级分类
    List<Category> selectRootCategories();

    boolean delCategory(Integer id);

    boolean addCategory(Category category);

    boolean updateCategory(Category category);

    Category selectCategoryById(Integer id);

    boolean checkName(String name, Integer type);
}
